package com.zwxu.cas.client.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping("/test")
public class UserController {
    @RequestMapping(value = "/index")
    public String index(HttpServletRequest request) {
        return "index";
    }

	@RequestMapping(value = "/pageOne")
    public String pageOne(HttpServletRequest request) {
        return "pageOne";
    }

    @RequestMapping(value = "/pageTwo")
    public String pageTwo(HttpServletRequest request) {
        return "pageTwo";
    }

	@RequestMapping(value = "/logout")
    public String logout(String url,HttpSession session){

        session.invalidate();
        return "redirect:http://localhost:8080/cas-server-webapp/logout?service=http://localhost:8080/cas-server-webapp/login?service="+url;
    }

}
